//
//  MusicPlayBarButton.m
//  One
//
//  Created by mac on 16/6/2.
//  Copyright © 2016年 mac. All rights reserved.
//

#import "MusicPlayBarButton.h"
#import "MiniMusicControlViewViewController.h"

@implementation MusicPlayBarButton

- (id)init
{
    self = [super init];
    if (self) {
        
        self.center = CGPointMake(WIDTH-100 + 20, 42);
        self.bounds = CGRectMake(0,0, 25, 25);
        [self setBackgroundImage:[UIImage imageNamed:@"myplayerstop_25x25_"] forState:UIControlStateNormal];
        [self addTarget:self action:@selector(buttonClick:) forControlEvents:UIControlEventTouchUpInside];
    }
    return self;
}

- (void)buttonClick:(UIButton *)sender
{
    UIWindow *window = [[[UIApplication sharedApplication]delegate]window];
    MiniMusicControlViewViewController *miniVC = [MiniMusicControlViewViewController shareMiniVC];
                                                
    [window addSubview:miniVC.view];

}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
